package cn.tedu.spring.eg3;

import cn.tedu.spring.life.Life;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private  String   meaning;
    public ShopController(){
        System.out.println("1.生命周期初始化阶段[调用无参构造方法]");
    }
    @Value("仗剑走天涯")
    public void setMeaning(String meaning) {
        this.meaning = meaning;
        System.out.println("2.属性赋值[set方法]");
    }

    @PostConstruct
    public void init(){
        System.out.println("3.生命周期初始化阶段");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("5.生命周期销毁方法");
    }


}
